<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button v-on:click="show = !show">点我呀</button>
      <br />
      <h1 v-if="show">看到我啦？！</h1>

      <h1 v-show="show">看到我啦？！</h1>

      <h1>固定显示</h1>

      <button v-on:click="random=Math.random()">点我呀</button
      ><span>{{random}}</span>
      <h1 v-if="random >= 0.75">看到我啦？！v-if >= 0.75</h1>
      <h1 v-else-if="random > 0.5">看到我啦？！v-else-if > 0.5</h1>
      <h1 v-else-if="random > 0.25">看到我啦？！v-else-if > 0.25</h1>
      <h1 v-else>看到我啦？！v-else</h1>
    </div>

    <script src="../node_modules/vue/dist/vue.js"></script>

    <script>
      let app = new Vue({
        el: "#app",
        data: {
          show: true,
          random: 1,
        },
      });
    </script>
  </body>
</html>
